package com.beordie.dao;

import com.beordie.model.Car;

import java.util.List;

/**
 * @Classname ICarDao
 * @Description TODO
 * @Date 2021/7/11 21:05
 * @Created 30500
 */
public interface ICarDao {
    String SELECT_ALL = "SELECT * FROM CAR";
    String SELECT_BY_LIMIT = "SELECT * FROM CAR LIMIT ? , ?";
    String SELECT_COUNT_ALL = "SELECT COUNT(1) FROM CAR";
    String SELECT_CAR_BY_NUMBER = "SELECT * FROM CAR WHERE NUMBER = ?";
    String INSERT = "INSERT INTO CAR VALUES(NULL,?,?,?,?,?,?,?)";
    String UPDATE = "UPDATE CAR SET NUMBER = ?, MODEL = ?, FACTORY = ?, CREATETIME = ?, SEAT = ?, COLOR = ?, PRICE = ? WHERE ID = ?";
    String DELETE = "DELETE FROM CAR WHERE ID = ?";

    public List<Car> getAllCars();
    public List<Car> getCarsByLimit(boolean isLimit, int start, int size);
    public Car getCarByNumber(String number);
    public int insert(Car car);
    public int updateById(Car car);
    public int deleteById(int id);
    public int getCount();
}
